home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
coreaids.arc
/
CHG_MOD.ASM
< prev
next >
Wrap
Assembly Source File
|
1987-06-25
|
1KB
|
46 lines
; DESC: Changes the mode of a file V1.00
; (ie archived, hidden, system)
; IN: *{SEG_VAL} segment and
; *{OFFSET} offset of filename
; *{FUNC_CODE} function code(1:set mode,0:get mode)
; *{FILE_MODE} mode of file (1:read only,2:hidden file,
; 4:system file,8:volume label,10H:sub-directory,
; 20H:archived file
; OUT: *{CMODE} mode of file after completions of call
; SAMPLE: Callm CHG_MOD,<SEG_VAL,OFFSET,FUNC_CODE,FILE_MODE>,<CMODE>
; ####################################################################
Extrn PUSHALL:Near
Extrn POPALL:Near
Extrn ERRORMSG:Near
CHG_MODC Segment
Assume CS:CHG_MODC
Public CHG_MOD
;notice.
DB 'CHG_MOD - V1.00, Copyright 1987, CoreTechs ',0DH,0AH
CHG_MOD Proc Near ;changes the mode of a file.
Call PUSHALL
Pop CX ;get new attribute.
Pop AX ;get function code.
Pop DX ;get filename offset.
Pop DS ;get segment offset.
Mov AH,43H ;changes the mode of a file.
Int 21H
Jc ERROR ;if error, report it.
Push CX ;return attribute if any.
Call POPALL
Ret
ERROR: Push AX ;report error and abort.
Call ERRORMSG
CHG_MOD Endp
CHG_MODC Ends
End